<h1><?php echo $title;?></h1>
<div id="search">
<?php echo form_open('cthesis/search');?>
	<table>
		<tr>
			<?php 
				echo "<td><label for='topic'>Topic</label><br/>";
				$data = array('name'=>'topic','id'=>'topic');
				echo form_input($data);
				echo "</td>";
				echo "<td><label for='uid'>Advisor</label><br/>";
				echo form_dropdown('uid',$lecturers);
				echo "</td>";
			?>	
		</tr>
		<tr>
			<?php 
				echo "<td><label for='firstname'>Student's FirstName</label><br/>";
				$data = array('name'=>'firstname','id'=>'firstname');
				echo form_input($data);
				echo "</td>";
				echo "<td><label for='lastname'>LastName</label><br/>";
				$data = array('name'=>'lastname','id'=>'lastname');
				echo form_input($data);
				echo "</td>";
			?>	
		</tr>
		<tr>
			<td colspan="2"><?php echo form_submit(array('class'=>'btn','name'=>'submit'),'Search');?></td>
		</tr>
	</table>
<?php echo form_close();?>
</div>
<p style="clear:right;">
	<a href="<?php echo base_url();?>index.php/cthesis/create"><input type="button" class="btn" value="Create Thesis" /></a>
</p>
<br />
<?php // echo anchor("cthesis/create", "Create thesis");?>
<?php
if ($this->session->flashdata('message')){
	echo "<div class='message'>".$this->session->flashdata('message')."</div>";
}

if (count($thesis)){
	echo "<table id='rounded-corner' class='bordered-table zebra-striped' cellspacing='0' cellpadding='3' width='100%'>\n";
	echo "<thead>\n<tr valign='top'>\n";
	echo "<th>No</th>\n<th>Topic</th><th>Student 1</th><th>Student 2</th><th>Student 3</th><th>Student 4</th><th>Adviser</th><th>Status</th><th>Activate</th><th>Actions</th>\n";
	echo "</tr>\n</thead>\n<tbody>\n";
	$i = 1;
	foreach ($thesis as $key => $list){
		echo "<tr valign='top'>\n";
		echo "<td align='center'>".$i++."</td>\n";
		echo "<td align='center'>".$list['topic']."</td>\n";
		echo "<td align='center'>".$list['stud1_lname'].' '.$list['stud1_fname']."</td>\n";
		echo "<td align='center'>".$list['stud2_lname'].' '.$list['stud2_fname']."</td>\n";
		echo "<td align='center'>".$list['stud3_lname'].' '.$list['stud3_fname']."</td>\n";
		echo "<td align='center'>".$list['stud4_lname'].' '.$list['stud4_fname']."</td>\n";
		echo "<td align='center'>".$list['lastname'].' '.$list['firstname']."</td>\n";
		echo "<td align='center'>".$list['status']."</td>\n";
		if($list['activate']==1) 
			$activate = 'active';
		else 
			$activate = 'inactive';
			
		echo "<td align='center'>". $activate."</td>\n";
		echo "<td align='center'>";
		echo anchor('cthesis/edit/'.$list['thesis_id'],'edit');
		echo " | ";
		echo anchor('cthesis/delete/'.$list['thesis_id'],'delete',array('class'=>'delete-item'));
		echo "</td>\n";
		echo "</tr>\n";
	}
	echo "</tbody>\n</table>";
}
?>